Release 10.1A: OpenEdge Development:
Java Open Clients


Supporting both browsers in one applet

The following code works for both Microsoft Internet Explorer and Navigator in a single applet:

import com.ms.security.*;
import netscape.security.PrivilegeManager; 
try 
{ 
// Assert Net IO privileges 
     System.out.println("Checking for Internet Explorer Security Manager"); 
      if (Class.forName("com.ms.security.PolicyEngine") != null) 
     PolicyEngine.assertPermission(PermissionID.NETIO); 
} 
catch(ClassNotFoundException e) 
{ 
       System.out.println("IE Security Manager not found"); 
} 
try 
{ 
        System.out.println("Checking for Netscape Security Manager"); 
        if (Class.forName("netscape.security.PrivilegeManager") != null) 
        { 
           try 
           { 
                   PrivilegeManager.enablePrivilege("UniversalConnect"); 
           } 
            catch(Exception ex) 
            { 
                   System.out.println("Netscape threw exception: " +
                   ex.toString());  
            } 
       } 
} 
catch(ClassNotFoundException e) 
{ 
        System.out.println("Netscape Security Manager not found"); 
} 

To test this code, make sure both security manager classes are in your CLASSPATH.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095